package com.apollographql.apollo.api;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.kt.Metadata;
import com.kt.Unit;
import com.kt.jvm.JvmStatic;
import com.kt.jvm.internal.DefaultConstructorMarker;
import com.kt.jvm.internal.Intrinsics;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b6\u0018\u0000 \u0006*\u0004\b\u0000\u0010\u00012\u00020\u0002:\u0007\u0006\u0007\b\t\n\u000b\fB\u000f\b\u0002\u0012\u0006\u0010\u0003\u001a\u00028\u0000¢\u0006\u0002\u0010\u0004R\u0012\u0010\u0003\u001a\u00028\u00008\u0006X\u0004¢\u0006\u0004\n\u0002\u0010\u0005\u0001\u0006\r\u000e\u000f\u0010\u0011\u0012¨\u0006\u0013"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue;", "T", "", "value", "(Ljava/lang/Object;)V", "Ljava/lang/Object;", "Companion", "GraphQLBoolean", "GraphQLJsonList", "GraphQLJsonObject", "GraphQLNull", "GraphQLNumber", "GraphQLString", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLNull;", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLString;", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLBoolean;", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLNumber;", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLJsonObject;", "Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLJsonList;", "apollo-api"}, k = 1, mv = {1, 4, 0})
/* compiled from: CustomTypeValue.kt */
public abstract class CustomTypeValue<T> {
    public static final Companion Companion = new Companion(null);
    public final T value;

    @JvmStatic
    public static final CustomTypeValue<?> fromRawValue(Object obj) {
        return Companion.fromRawValue(obj);
    }

    private CustomTypeValue(T t) {
        this.value = t;
    }

    public /* synthetic */ CustomTypeValue(Object value2, DefaultConstructorMarker $constructor_marker) {
        this.value= (T) $constructor_marker;
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\bÆ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLNull;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "()V", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLNull extends CustomTypeValue<Unit> {
        public static final GraphQLNull INSTANCE = new GraphQLNull();

        private GraphQLNull() {
            super(Unit.INSTANCE, null);
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0002J\b\u0010\t\u001a\u00020\nH\u0016¨\u0006\u000b"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLString;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "value", "(Ljava/lang/String;)V", "equals", "", "other", "", "hashCode", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLString extends CustomTypeValue<String> {
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public GraphQLString(String value) {
            super(value, null);
            Intrinsics.checkParameterIsNotNull(value, "value");
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if ((other instanceof GraphQLString) && !(!Intrinsics.areEqual((String) this.value, (String) ((GraphQLString) other).value))) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return ((String) this.value).hashCode();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00022\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0002J\b\u0010\b\u001a\u00020\tH\u0016¨\u0006\n"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLBoolean;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "value", "(Z)V", "equals", "other", "", "hashCode", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLBoolean extends CustomTypeValue<Boolean> {
        public GraphQLBoolean(boolean value) {
            super(Boolean.valueOf(value), null);
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if ((other instanceof GraphQLBoolean) && ((Boolean) this.value).booleanValue() == ((Boolean) ((GraphQLBoolean) other).value).booleanValue()) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return this.value.hashCode();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0004\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0002\u0010\u0004J\u0013\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0002J\b\u0010\t\u001a\u00020\nH\u0016¨\u0006\u000b"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLNumber;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "value", "(Ljava/lang/Number;)V", "equals", "", "other", "", "hashCode", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLNumber extends CustomTypeValue<Number> {
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public GraphQLNumber(Number value) {
            super(value, null);
            Intrinsics.checkParameterIsNotNull(value, "value");
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if ((other instanceof GraphQLNumber) && !(!Intrinsics.areEqual((Number) this.value, (Number) ((GraphQLNumber) other).value))) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return ((Number) this.value).hashCode();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\u0018\u00002\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00040\u00020\u0001B\u0019\u0012\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00040\u0002¢\u0006\u0002\u0010\u0006J\u0013\u0010\u0007\u001a\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\u0004H\u0002J\b\u0010\n\u001a\u00020\u000bH\u0016¨\u0006\f"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLJsonObject;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "", "", "value", "(Ljava/util/Map;)V", "equals", "", "other", "hashCode", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLJsonObject extends CustomTypeValue<Map<String, ? extends Object>> {
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public GraphQLJsonObject(Map<String, ? extends Object> map) {
            super(map, null);
            Intrinsics.checkParameterIsNotNull(map, "value");
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if ((other instanceof GraphQLJsonObject) && !(!Intrinsics.areEqual((Map) this.value, (Map) ((GraphQLJsonObject) other).value))) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return this.value.hashCode();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001B\u0013\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0002¢\u0006\u0002\u0010\u0005J\u0013\u0010\u0006\u001a\u00020\u00072\b\u0010\b\u001a\u0004\u0018\u00010\u0003H\u0002J\b\u0010\t\u001a\u00020\nH\u0016¨\u0006\u000b"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$GraphQLJsonList;", "Lcom/apollographql/apollo/api/CustomTypeValue;", "", "", "value", "(Ljava/util/List;)V", "equals", "", "other", "hashCode", "", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class GraphQLJsonList extends CustomTypeValue<List<? extends Object>> {
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public GraphQLJsonList(List<? extends Object> list) {
            super(list, null);
            Intrinsics.checkParameterIsNotNull(list, "value");
        }

        public boolean equals(Object other) {
            if (this == other) {
                return true;
            }
            if ((other instanceof GraphQLJsonList) && !(!Intrinsics.areEqual((List) this.value, (List) ((GraphQLJsonList) other).value))) {
                return true;
            }
            return false;
        }

        public int hashCode() {
            return this.value.hashCode();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0014\u0010\u0003\u001a\u0006\u0012\u0002\b\u00030\u00042\u0006\u0010\u0005\u001a\u00020\u0001H\u0007¨\u0006\u0006"}, d2 = {"Lcom/apollographql/apollo/api/CustomTypeValue$Companion;", "", "()V", "fromRawValue", "Lcom/apollographql/apollo/api/CustomTypeValue;", "value", "apollo-api"}, k = 1, mv = {1, 4, 0})
    /* compiled from: CustomTypeValue.kt */
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
            this();
        }

        @JvmStatic
        public final CustomTypeValue<?> fromRawValue(Object value) {
            Intrinsics.checkParameterIsNotNull(value, "value");
            if (value instanceof Map) {
                return new GraphQLJsonObject((Map) value);
            }
            if (value instanceof List) {
                return new GraphQLJsonList((List) value);
            }
            if (value instanceof Boolean) {
                return new GraphQLBoolean(((Boolean) value).booleanValue());
            }
            if (value instanceof BigDecimal) {
                return new GraphQLNumber(BigDecimalKt.toNumber((BigDecimal) value));
            }
            if (value instanceof Number) {
                return new GraphQLNumber((Number) value);
            }
            return new GraphQLString(value.toString());
        }
    }
}
